// Learn TypeScript:
//  - https://docs.cocos.com/creator/2.4/manual/en/scripting/typescript.html
// Learn Attribute:
//  - https://docs.cocos.com/creator/2.4/manual/en/scripting/reference/attributes.html
// Learn life-cycle callbacks:
//  - https://docs.cocos.com/creator/2.4/manual/en/scripting/life-cycle-callbacks.html

import BaseUI from "../framwork/BaseUI";

const {ccclass, property} = cc._decorator;

@ccclass
export default class gridItem extends BaseUI {
    baseUI_onLoad(): void {

    }
    baseUI_onDestroy(): void {

    }
    onBtn_click(target: cc.Button, onBtn_name: string): number | void {

    }
    data;
    init_data(d: any): void {

    }
    setData(data){
        this.data = data;
        console.log(data);
        this.data = data;
        this.SetLabel("str",data.name);
        let huanguans = this.GetGameObject("huangguan").children;
        for (let index = 0; index < huanguans.length; index++) {
            huanguans[index].active = false;
        }
        for (let index = 0; index < data.huanguan; index++) {
            huanguans[index].active = true;
        }
    }
}
